﻿using FastUtil.Config;
using FastUtil.Convert;
using FastUtil.Extra;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.Text;

namespace FastORM.Entity
{
    public class CacheTransition
    {
        public IBatch BatchExecute { set; get; }
        public CacheTransition()
        {
            BatchExecute = RedisUtil.GetConnectInstance().GetDatabase(ValueConvert.ConvertToInt32(AppConfigUtil.Configuration["Redis:RedisCacheDBNum"])).CreateBatch();
        }
        public void Commit()
        {
            if (BatchExecute != null)
            {
                BatchExecute.Execute();
            }
        }
    }
}
